package com.sk.bilibili.view.fragment.search;

import androidx.viewbinding.ViewBinding;

import com.sk.bilibili.adapter.pager.search.SearchFragmentAdapter;
import com.sk.bilibili.adapter.vlayout.BaseCollectionAdapter;
import com.sk.bilibili.adapter.vlayout.search.ThemAdapter;
import com.sk.bilibili.bean.Them;
import com.sk.bilibili.callBack.ThemClickCallBack;
import com.sk.bilibili.model.fragment.search.ThemModel;
import com.sk.bilibili.view.activity.ThemActivity;

public class ThemFragment extends BaseSearchFragment<ThemModel, Them> implements ThemClickCallBack {

    private Integer typeId;

    public ThemFragment(SearchFragmentAdapter parent, int pos,Integer typeId) {
        super(parent, pos);
        this.typeId=typeId;
    }

    public Integer getTypeId() {
        return typeId;
    }

    @Override
    protected BaseCollectionAdapter<? extends ViewBinding, Them> getAdapter() {
        return new ThemAdapter(getContext(),this);
    }

    @Override
    public void onThemClick(Integer themId, int selection) {
        ThemActivity.start(getContext(),themId,selection);
    }

    @Override
    public void onFollowClick(Integer id) {
        model.followThem(id);
    }

    public void followThemSuccess() {
        toast("自己追的番一定要看完欧");
    }

}